package com.marketingexpert.service.publicmgnt.impl;

import java.util.List;

import net.sf.json.JSONArray;

import com.marketingexpert.service.publicmgnt.PublicPageService;
import com.marketingexpert.service.snsmgnt.SnsService;
import com.marketingexpert.service.snsmgnt.SnsServiceFactory;
import com.marketingexpert.service.snsmgnt.Status;

public class PublicPageServiceImpl implements PublicPageService {

	private SnsServiceFactory snsServiceFactory;
	
	public List<Status> statusSearch(String q,String type,int page,String token, String secret) {
		
		SnsService snsService;
		
		if(type.equals("sina")) {
			snsService = getSnsServiceFactory().getService(SnsServiceFactory.SINA);
		} else {
			snsService = getSnsServiceFactory().getService(SnsServiceFactory.TECENT);
		}
		
		JSONArray searchResult = snsService.getTrendTimeline(token, secret, page, null, q, null);
		
		
		
		return null;
	}

	public SnsServiceFactory getSnsServiceFactory() {
		return snsServiceFactory;
	}

	public void setSnsServiceFactory(SnsServiceFactory snsServiceFactory) {
		this.snsServiceFactory = snsServiceFactory;
	}
}
